import request from '@/utils/request'

// 查询课程安排列表
export function listSchedule(query) {
  return request({
    url: '/jwgl/schedule/list',
    method: 'get',
    params: query
  })
}

// 查询课程安排详细
export function getSchedule(id) {
  return request({
    url: '/jwgl/schedule/' + id,
    method: 'get'
  })
}

// 新增课程安排
export function addSchedule(data) {
  return request({
    url: '/jwgl/schedule',
    method: 'post',
    data: data
  })
}

// 修改课程安排
export function updateSchedule(data) {
  return request({
    url: '/jwgl/schedule',
    method: 'put',
    data: data
  })
}

// 删除课程安排
export function delSchedule(id) {
  return request({
    url: '/jwgl/schedule/' + id,
    method: 'delete'
  })
}

// 导出课程安排
export function exportSchedule(query) {
  return request({
    url: '/jwgl/schedule/export',
    method: 'get',
    params: query
  })
}

// 智能排课
export function generateSchedule(data) {
  return request({
    url: '/jwgl/schedule/generate',
    method: 'post',
    data: data
  })
}

// 检测课程冲突
export function checkConflict(data) {
  return request({
    url: '/jwgl/schedule/conflict',
    method: 'post',
    data: data
  })
}